I have a problem. I'm writing a panel for my discord bot, I'm using ejs. The server is based on the express and passport library. The problem is that I want to display the name of the mysql database but I am not getting the result in the browser and with other results the result is displayed. Please help. I'm posting the code.
main.ejs
<%= server.guild_id %> <!-- 76593313568....704 -->
<% database.sql("SHOW DATABASES", 0, (rows) => { %>
<%= rows[0].Database %> <!-- nothing -->
<% }) %>
dashboard.js - route
const router = require('express').Router()
const database = require('./../database/database.js')
[...]
res.render('dashboard/server/main', {
guilds: req.user.guilds,
servers: rows,
user: req.user,
admin: false,
points: 0,
server: server,
database: database
})
If I use the console.log code, I can see the database without any problems